﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Secams.utils
{
    class ModelUtil
    {
        public static string[] stringArrayVals(object obj, string[] props)
        {
            string[] retval = new string[props.Length];
            int i = 0;
            foreach (string prop in props)
            {
                PropertyInfo propInfo = obj.GetType().GetProperty(prop);
                object valObj = propInfo.GetValue(obj, null);
                retval[i++] = (valObj != null) ? valObj.ToString() : "";
            }
            return retval;

        }
    }
}
